import request from '@/utils/request'

// 获取用户频道列表
export const getUserList = () => {
  return request({
    method: 'get',
    url: '/v1_0/user/channels'
  })
}
// 获取文章列表
export const getArticleList = (channelId, timestamp) => {
  return request({
    method: 'get',
    url: '/v1_0/articles',
    params: {
      channel_id: channelId,
      timestamp
    }
  })
}

// 获取所有频道列表
export const getAllChannelList = () => {
  return request({
    method: 'get',
    url: '/v1_0/channels'
  })
}

// 更新用户频道
export const updateChannelList = (channels) => {
  return request({
    method: 'put',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })
}
